<?php
/**
 * @package		Joomla.Site
 * @subpackage	com_content
 * @copyright	Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

// no direct access
defined('_JEXEC') or die;

// Create a shortcut for params.
$params = &$this->item->params;
$images = json_decode($this->item->images);
$canEdit	= $this->item->params->get('access-edit');
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::core();

?>
<div class="pb10 ofh pr10 pdduct">
<?php
		preg_match('/\/(.*?)\//',$this->item->title, $match);
		//var_dump($match);
		if (count($match)) {
			$this->item->title = str_replace($match[0], '', $this->item->title);
			echo '<div class="fr ttu fwn" style="background: none repeat scroll 0 0 #0BA1B8;color: #000000; height: 20px;margin-top: 5px;padding: 7px 7px 0; font-family: "HelveticaNeueMedium" !important;">'.$match[1].'</div>';
		}
	
	?>
	<h3 class="cf4 fs15 mb10 ff2">
	
		<a class="cf4 fwb" href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid)); ?>"><?php echo $this->item->title; ?></a>
	</h3>
		<div class="fl pr10">		
				<a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid)); ?>" >
			
			
			
			<?php
			//code lay hinh
				$arr2 = preg_split('/<(IMG|img) /', $this->item->introtext);
	
	
				//if(sizeof($arr2) <= 1) return '';
			    
			    
				$arr3 = preg_split('/src=\"/', $arr2[1]);
			    
			    
				//if(sizeof($arr3) <= 1) return '';
			    
				$arr4 = preg_split('/\"/', $arr3[1]);
			    
			    
			    
				if(preg_match('/http:/', $arr4[0]))
				{
				    $result = $arr4[0];
				}
				else if(preg_match('/^\//', $arr4[0])){
				    $result = $u2 . substr($arr4[0],1);
				}
				else
				{
				    for($ei = 3; $ei < sizeof($u1) - 1; $ei++)
				    {
					$u2 .= $u1[$ei] . "/";
				    }
				    $result = $u2 . $arr4[0];
				}
			
			?>
<?php if ($result!="") { ?><img src="<?php echo $result; ?>" alt="<?php echo $item->title; ?>" class="" title="<?php echo $item->title; ?>"  width="180" height="101" /> <?php } ?>
				</a>        
		</div>			
					

			
				
		<div >			
					<p class="pa0">
					
						<?php 
				
										$arr = explode(" ", strip_tags($this->item->introtext));
										if(count($arr) >= 60)
										{
											$this->item->sintrotext = "";
											for($i=0; $i < 60; $i++)
											{
												$this->item->sintrotext .= $arr[$i]." ";
											}
											$this->item->sintrotext .= "...";
										}
										else $this->item->sintrotext = strip_tags($this->item->introtext);
										$this->item->sintrotext = str_replace("\"", "", $this->item->sintrotext);
										
										echo $this->item->sintrotext;
						?>
					</p>
					<div class="mt5 readmore">
						<a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid)); ?>" class="button cf4"><?php echo JTEXT::_("COM_CONTENT_READ_MORE_TITLE"); ?></a>
					</div>
		</div>	
</div>
<div class="clear"></div>
<?php echo $this->item->event->afterDisplayContent; ?>
